package Class.Advance.Inherit.AccessControl;

class World{
    public void announce(){
        System.out.println("I'm the world!");
    }
}

class China extends World{
    public void announce(){
        System.out.println("We are China!");
    }

    //通过this访问子类中的方法
    public void announceMyself(){
        this.announce();
    }

    //通过super访问父类中同名的方法
    public void announceWorld(){
        super.announce();
    }
}

public class MethodAccess {
    public static void main(String[] args) {
        China china = new China();
        china.announceMyself();
        china.announceWorld();
    }
}
